/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$(document).ready(function(){
   
    $("textarea").bind("keyup keydown", function(event){
        var caracters = $(this).val().length;
        var maximo = 100;
        //console.log(maximo - caracters);
        $(this).siblings("span").children("b").text(maximo - caracters);
        if(maximo - caracters < 0 ) $(this).attr("readonly", "true");
        
        var tecla = event.which;
        
        if(tecla > 47 && tecla <58){
            return true;
        }else{
            return false;
        }
        
    });
    
});


